import { Button } from "antd";
import { inject, observer } from "mobx-react";
import * as React from "react";
import { USER } from "../mobx/Stores";
import HooksDemo from "./HooksDemo";
import { SearchBar } from "antd-mobile";

/**
 * 描述：
 *  用户信息
 * @author sunshixiong
 * @date 2019/2/18-10:08
 */

interface Iprops {
  user?: any;
}

@inject(USER)
@observer
class UserInfo extends React.Component<Iprops> {
  public clickDiv = (e: any) => {
    console.log(this.props);
    this.props.user.getUserInfo();
  };
  public render() {
    return (
      <div>
        <SearchBar placeholder="Search" maxLength={8} />
        <HooksDemo name={"孙士雄"} />
        <Button onClick={this.clickDiv}>UserInfo</Button>
      </div>
    );
  }
}

export default UserInfo;
